home *** CD-ROM | disk | FTP | other *** search
- Subject: Re: Forcing a draw
- Sent: 5/20/96 11:54 AM
- Received: 5/22/96 8:31 AM
- From: Laurent Delamare, laurentd@apple.com
- Reply-To: ODF-Interest@CILabs.ORG
- To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
-
- (I am resending this reply from last friday. It was returned to me with
- the following error message "Returned mail: too many hops 19 (17 max)"...
- does anyone know what it means??)
-
- >
- >The interface Draw(Environment *ev, ODFacet* odFacet, ODShape* invalidShape)
- >requires an ODFacet. How does a plain old FW_CView get hold of the right
- >facet?
- >
-
- Bill,
-
- During normal updates a view's Draw method is called with the current
- facet at which the update event is targeted (OpenDoc generates update
- events for each facet).
- If you want to force a redraw yourself you must iterate on ALL the facets
- of your frame otherwise you risk to miss something!
-
- You may say: my part never opens more than 1 facet per frame, why bother?
- The problem is that you never know where your part will be embedded and
- what treatment it will suffer :-) For instance, as a test, try the Embed
- sample of ODF 1 which can split your part into 4 facets (a future version
- will even make the facets rotate to create more confusion).
-
- The correct way to handle facet drawing is thus to iterate as follows in
- your view class:
-
- FW_CFrameFacetIterator ite(ev, GetFrame(ev));
- for (ODFacet* facet = ite.First(ev); ite.IsNotComplete(ev);
- facet = ite.Next(ev))
- {
- FW_CViewContext vc(ev, this, facet);
-
- // now you can draw in the right facet with the right view context
-
- }
-
- This doesn't add any overhead in the general case of 1 facet per frame.
-
-
-
- ______________________________________________________________________
- Laurent Delamare laurentd@apple.com
- ODF Team http://www.devtools.apple.com/odf/
- Apple Computer, Inc. http://www.opendoc.apple.com/
-